<?php
class Mpay_merchant_model extends CI_Model {
    public function __construct() {
        $this->sws = $this->load->database ( 'sws', TRUE );
    }
    
    /**
     *
     * 查询商户密钥
     * 
     * @name query_merchant_key
     * @param unknown $merchant_id            
     * @return unknown
     * @author Eifel.Deng 2015年3月23日
     */
    public function query_merchant_key($merchant_id) {
        $merchant_id = $this->sws->escape ( $merchant_id );
        $sql = "select MERCHANT_KEY from sdk_merchant where MERCHANT_ID=$merchant_id limit 1";
        $query = $this->sws->query ( $sql );
        if ($query->num_rows () > 0) {
            $row = $query->row_array ();
            return $row ['MERCHANT_KEY'];
        }
    }
}

 
 
 
 /**
 *End of file 'mpay_merchant_model.php';	
 *Location './mpay/application/models/mpay_merchant_model.php'
 */